function F = fieldnames(S)
% BVQXfigure::fieldnames  - return pseudo fieldnames

% Version:      v0.7b
% Build:        7090409
% Date:         Sep-04 2007, 9:04 AM CEST
% Author:       Jochen Weber, Brain Innovation, B.V., Maastricht, NL
% URL / Info:   http://wiki.brainvoyager.com/BVQXtools

% not allowed for larger arrays
if numel(S) ~= 1
    error( ...
        'BVQXfile:BadArgument', ...
        'Fieldnames can only be obtain for 1x1 objects.' ...
    );
end

% sort methods with section names
try
    sets = fieldnames(get(S.mhnd));
    meth = methods(S);
    F = sort([sets(:); meth(:)]);
catch
    rethrow(lasterror);
end
